package org.tjc.net.manager.config.json;

import javax.naming.Context;

/**
 * @Author: tjc
 * @description
 * @Date Created in 18:38 2021-01-01
 */
public class ContextFacade {
    private NgMainModule context;

    private int serverIndex;

    public ContextFacade(NgMainModule context, int index) {
        this.context = context;
        if(index >= context.getServerConfs().size()) {
            throw new RuntimeException("index out of serverConfs.");
        }

        serverIndex = index;
    }

    public NgServerModule getServer(){
        return context.getServerConfs().get(serverIndex);
    }
}
